/*
 * XInput1_3-dev - Replacement of xinput library to help with creating
 *                 drivers/debugging application
 *
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3.0 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library.
 */

#include "stdafx.h"

#include "Protocol.h"

GUID Protocol::XUSB_INTERFACE_CLASS_GUID = { 0xEC87F1E3, 0xC13B, 0x4100, 0xB5, 0xF7, 0x8B, 0x84, 0xD5, 0x42, 0x60, 0x0CB };
DWORD Protocol::IOCTL_XINPUT_GET_INFORMATION = 0x80006000;
DWORD Protocol::IOCTL_XINPUT_GET_CAPABILITIES = 0x8000E004;
DWORD Protocol::IOCTL_XINPUT_GET_LED_STATE = 0x8000E008;
DWORD Protocol::IOCTL_XINPUT_GET_GAMEPAD_STATE = 0x8000E00C;
DWORD Protocol::IOCTL_XINPUT_SET_GAMEPAD_STATE = 0x8000A010;
DWORD Protocol::IOCTL_XINPUT_WAIT_FOR_GUIDE_BUTTON = 0x8000E014;
DWORD Protocol::IOCTL_XINPUT_GET_BATTERY_INFORMATION = 0x8000E018;
DWORD Protocol::IOCTL_XINPUT_POWER_DOWN_DEVICE = 0x8000A01C;
DWORD Protocol::IOCTL_XINPUT_GET_AUDIO_INFORMATION = 0x8000E020;
unsigned char const Protocol::LEDState::XINPUT_LED_OFF = 0;
unsigned char const Protocol::LEDState::XINPUT_LED_BLINK = 1;
unsigned char const Protocol::LEDState::XINPUT_LED_1_SWITCH_BLINK = 2;
unsigned char const Protocol::LEDState::XINPUT_LED_2_SWITCH_BLINK = 3;
unsigned char const Protocol::LEDState::XINPUT_LED_3_SWITCH_BLINK = 4;
unsigned char const Protocol::LEDState::XINPUT_LED_4_SWITCH_BLINK = 5;
unsigned char const Protocol::LEDState::XINPUT_LED_1 = 6;
unsigned char const Protocol::LEDState::XINPUT_LED_2 = 7;
unsigned char const Protocol::LEDState::XINPUT_LED_3 = 8;
unsigned char const Protocol::LEDState::XINPUT_LED_4 = 9;
unsigned char const Protocol::LEDState::XINPUT_LED_CYCLE = 10;
unsigned char const Protocol::LEDState::XINPUT_LED_FAST_BLINK = 11;
unsigned char const Protocol::LEDState::XINPUT_LED_SLOW_BLINK = 12;
unsigned char const Protocol::LEDState::XINPUT_LED_FLIPFLOP = 13;
unsigned char const Protocol::LEDState::XINPUT_LED_ALLBLINK = 14;
unsigned char const Protocol::LEDState::XINPUT_LED_MAX = 15;
unsigned char const Protocol::LEDState::XINPUT_PORT_TO_LED_MAP[] = {6, 7, 8, 9};
unsigned char const Protocol::LEDState::XINPUT_LED_TO_PORT_MAP[] = {0xFF, 0xFF, 0, 1, 2, 3, 0, 1, 2, 3, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};